//
//  BVMineTool.h
//  BuyVegetable
//
//  Created by yushanchang on 16/10/12.
//  Copyright © 2016年 com.yinding. All rights reserved.
//

#import "BVBaseTool.h"

@interface BVMineTool : BVBaseTool

+ (void)fetchMineData:(void(^)(NSArray *localArr))success;

/**
 *  获取验证码
 *
 *  @param mobile  手机号
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)fetchVerifyCode:(NSString *)mobile success:(void(^)(NSString *status))success failure:(void(^)(NSError *error))failure;

/**
 *
 *  @param mobile       手机号
 *  @param verify_code  验证码
 *  @param password     密码
 *  @param success      成功回调
 *  @param failure      失败回调
 */
- (void)registered:(NSString *)mobile verify_code:(NSString *)verify_code password:(NSString *)password success:(void (^)(NSMutableDictionary *))success failure:(void (^)(NSError *))failure;

/**
 *  登录
 *
 *  @param mobile   手机号
 *  @param password 密码
 *  @param success  成功回调
 *  @param failure  失败回调
 */
- (void)loginByMobile:(NSString *)mobile  password:(NSString *)password success:(void(^)(NSString *status))success failure:(void(^)(NSError *error))failure;

/**
 *  上传图片
 *
 *  @param image   图片
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)settingUserAvatar:(UIImage *)image success:(void (^)())success failure:(void (^)(NSError *error))failure;

/**
 *  退出登录
 *
 *  @param success 成功回调
 *  @param failure 失败回调
 */
- (void)logoutSuccess:(void(^)(NSString *status))success failure:(void(^)(NSError *error))failure;

// 获取用户信息
- (void)fetchUserInfoSuccess:(void(^)())success failure:(void(^)(NSError *error))failure;

// 修改用户地址
- (void)modifyUserAddress:(NSString *)address detailAddr:(NSString *)detailAddr provId:(NSString *)provId cityId:(NSString *)cityId success:(void(^)())success failure:(void(^)(NSError *error))failure;

// 修改用户生日
- (void)modifyUserBirthday:(NSString *)birthday success:(void(^)())success failure:(void(^)(NSError *error))failure;

// 修改用户名字
- (void)modifyUserName:(NSString *)name success:(void(^)())success failure:(void(^)(NSError *error))failure;

// 修改用户电话
- (void)modifyUserMobile:(NSString *)mobile success:(void(^)())success failure:(void(^)(NSError *error))failure;

// 修改用户性别
- (void)modifyUserSex:(NSInteger)sex success:(void(^)())success failure:(void(^)(NSError *error))failure;

// 获取优惠卷
- (void)fetchUserCoupon:(NSString *)type success:(void (^)(NSMutableArray *))success failure:(void (^)(NSError *error))failure;
@end
